// Listing 19.1 A template of an array class
#include <iostream>

using namespace std;
const int DefaultSize = 10;

template <class T> // declare the template and the parameter
class MyArray {
public:
  MyArray(int itsSize = DefaultSize);
  MyArray(const MyArray &rhs);
  ~MyArray() { delete[] pType; }

  // operators
  MyArray &operator=(const MyArray &);
  T &operator[](int offSet) { return pType[offSet]; }
  // accessors
  int GetSize() { return itsSize; }

private:
  T *pType;
  int itsSize;
};
